<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试分页对象</title>
</head>
<body>
    <!--分页数据-->
    {% for p in c_page %}
        {{ p }}
    {% endfor %}

    <hr>

    <!--上一页-->
    {% if c_page.has_previous %}
        <a href="/note/test_page?page={{ c_page.previous_page_number }}">上一页</a>
        {% else %}
        上一页
    {% endif %}

    {% for p_num in paginator.page_range %}
        {% if p_num == c_page.number %}
            {{ p_num }}
            {% else %}
            <a href="/note/test_page?page={{ p_num }}">{{ p_num }}</a>
        {% endif %}
    {% endfor %}

    {% if c_page.has_next %}
        <a href="/note/test_page?page={{ c_page.next_page_number }}">下一页</a>
    {% else %}
        下一页
    {% endif %}

</body>
</html>